import logging,yagmail,time


def get_log():
    t = time.strftime('%Y%m%d-%H%M%S', time.localtime())
    logging.basicConfig(filename=t+'_log.log',filemode='a',level=logging.DEBUG,format='%(message)s->%(levelname)s->%(asctime)s')
    log=logging.getLogger()
    return log

def send_email(log,html):
    send=yagmail.SMTP(user='1418953961@qq.com',password='flmhycefgeagbadj',host='smtp.qq.com')
    send.send(to='1418953961@qq.com',subject='月考邮件',contents='正文',attachments=[log,html])

